<?php
echo form::open('admin/seminarWizard/next', array('id'=>'wizardForm'));
?>

<ul class="discountList">

	<li>
        <?php $blockName = 'lateCharge'; ?>
        <label>
            <?php echo form::checkbox($blockName . 'Enabled', sql::$TRUE, $chargesForm[$blockName . 'Enabled'], 'onchange="toggleDiscountBlock(\'' . $blockName . 'Block\', this)"'); ?>
            <em class="textWithAction"><?php echo text::getEscaped('seminar.' . $blockName) ?></em>
        </label>
        <p class="description"><?php echo text::getEscaped('seminar.' . $blockName . '-desc') ?></p>

        <div id="<?php echo $blockName; ?>Block" class="<?php echo $chargesForm[$blockName . 'Enabled'] == sql::$TRUE ? '' : 'hidden'; ?>">
            <table class="formTable">
                <tbody>
                    <tr>
                        <?php $inputFieldName = 'lateChargeAppliesToKarmayoga'; ?>
                        <th><label for="<?php echo $inputFieldName; ?>"><?php echo text::getEscaped('seminar.chargeAppliesToKarmayoga') ?></label></th>
                        <td><?php echo form::yesNoComboBox($inputFieldName, $chargesForm[$inputFieldName]) ?></td>
                    </tr>
                    <tr>
                        <?php $inputFieldName = 'lateChargeAppliesToShortPrograms'; ?>
                        <th><label for="<?php echo $inputFieldName; ?>"><?php echo text::getEscaped('seminar.appliesToShortPrograms') ?></label></th>
                        <td><?php echo form::yesNoComboBox($inputFieldName, $chargesForm[$inputFieldName]) ?></td>
                    </tr>
                    <tr>
                        <?php $inputFieldName = 'lateChargePercentage'; ?>
                        <th><label for="<?php echo $inputFieldName; ?>"><?php echo text::getEscaped('seminar.lateChargePercentage') ?></label></th>
                        <td><?php echo form::integer($inputFieldName, $chargesForm[$inputFieldName]) ?> %</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </li>

    <!-- Cancellation charges -->
    <li>
        <?php $blockName = 'cancellationCharge'; ?>
        <label>
            <?php echo form::checkbox($blockName . 'Enabled', sql::$TRUE, $chargesForm[$blockName . 'Enabled'], 'onchange="toggleDiscountBlock(\'' . $blockName . 'Block\', this)"'); ?>
            <em class="textWithAction"><?php echo text::getEscaped('seminar.' . $blockName) ?></em>
        </label>
        <p class="description"><?php echo text::getEscaped('seminar.' . $blockName . '-desc') ?></p>

        <div id="<?php echo $blockName; ?>Block" class="<?php echo $chargesForm[$blockName . 'Enabled'] == sql::$TRUE ? '' : 'hidden'; ?>">
            <table class="formTable">
                <tbody>
                    <tr>
                        <?php $inputFieldName = 'cancellationAppliesToKarmayoga'; ?>
                        <th><label for="<?php echo $inputFieldName; ?>"><?php echo text::getEscaped('seminar.chargeAppliesToKarmayoga') ?></label></th>
                        <td><?php echo form::yesNoComboBox($inputFieldName, $chargesForm[$inputFieldName]) ?></td>
                    </tr>
                    <tr>
                        <?php $inputFieldName = 'cancellationChargeBeforeDeadline'; ?>
                        <th><label for="<?php echo $inputFieldName; ?>"><?php echo text::getEscaped('seminar.' . $inputFieldName) ?></label></th>
                        <td><?php echo form::integer($inputFieldName, $chargesForm[$inputFieldName]) ?> %</td>
                    </tr>
                    <tr>
                        <?php $inputFieldName = 'cancellationChargeAfterDeadline'; ?>
                        <th><label for="<?php echo $inputFieldName; ?>"><?php echo text::getEscaped('seminar.' . $inputFieldName) ?></label></th>
                        <td><?php echo form::integer($inputFieldName, $chargesForm[$inputFieldName]) ?> %</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </li>
</ul>

<?php
// On arrival payment fees
echo '<h3>' . text::getEscaped('seminarWizard-onArrivalPaymentFee') . '</h3>';
echo '<p class="description">' . text::getEscaped('seminarWizard-onArrivalPaymentFee-desc') . '</p>';
echo '<p class="description">' . text::getEscaped('seminarWizard-onArrivalPaymentFee-exceptions') . '</p>';
echo '<p class="description">' . text::getEscaped('seminarWizard-onArrivalPaymentFee-notRequired') . '</p>';

$fb = new FormBuilder('seminar', $chargesForm);
$fb->doNotOpenForm();
$fb->doNotCloseForm();
$fb->integer('payment_on_arrival_fee_czk')->appendix(text::get('currency.mark-CZK'))->required();
$fb->integer('payment_on_arrival_fee_eur')->appendix(text::get('currency.mark-EUR'))->required();
$fb->write();
?>

</form>
